import os, base64


with open('1.jpg', 'rb') as f:
    content = base64.b64encode(f.read())
    print(content)